//
//  WBxxxxViewController.m
//  myWeibo
//
//  Created by 何达达mac on 2018/5/26.
//  Copyright © 2018年 hedada. All rights reserved.
//

#import "WBxxxxViewController.h"

@interface WBxxxxViewController ()

@end

@implementation WBxxxxViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self setbackNav];
}
-(void)setbackNav{
    // 返回按钮
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    // 设置frame
    backButton.frame =CGRectMake(200, 13, 18,18);
    [backButton setTitle:@"返回" forState:UIControlStateNormal];
    [backButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    // 自定义导航栏的UIBarButtonItem类型的按钮
    UIBarButtonItem *backView = [[UIBarButtonItem alloc]initWithCustomView:backButton];
    // 返回按钮设置成功
    self.navigationItem.leftBarButtonItem =  backView;
    
}

-(void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
